<%=
demo = Class.new(ApplicationComponent) do

  def initialize(leading_accessory:)
    @leading_accessory = leading_accessory
  end

  def view_template(&)
    div class: "flex gap-4" do
      render Form::TextInputComponent.new do |input|
        input.input do
          input(type: "search", class: "peer text-input", placeholder: "Placeholder")
        end
        if @leading_accessory
          input.accessory_leading do
            Icon("icon-search", class: "ml-2 fill-400 pg-focus:fill-blue-600")
          end
        end
      end

      render Form::TextInputComponent.new do |input|
        input.input do
          input(type: "search", class: "peer text-input", placeholder: "Placeholder", data: {focused: true})
        end
        if @leading_accessory
          input.accessory_leading do
            Icon("icon-search", class: "ml-2 fill-400 pg-focus:fill-blue-600")
          end
        end
      end

      render Form::TextInputComponent.new do |input|
        input.input do
          input(type: "search", class: "peer text-input", placeholder: "Placeholder", disabled: true)
        end
        if @leading_accessory
          input.accessory_leading do
            Icon("icon-search", class: "ml-2 fill-400 pg-focus:fill-blue-600")
          end
        end
      end
    end
  end
end
render demo.new(leading_accessory: leading_accessory)
%>
